import url from "@/url.config";
export default ({ service, request, tools }) => ({
    carsave(data) {
        return request({
            url: url.ip1 + "/car/save",
            method: "post",
            data: data,
        });
    },
    carquery(data) {
        //车辆信息分页查询
        return request({
            url: url.ip1 + "/car/findByPage",
            method: "post",
            data: data,
        });
    },
    carmaintain(data) {
        return request({
            url: url.ip1 + "/car/maintain/findByPage",
            method: "post",
            data: data,
        });
    },
    //获取token
    getCarToken() {
        return request({
            url: url.ip1 + "/car/monitor/token",
            method: "get",
        });
    },

    //根据车牌查询车辆识别码
    getCarPlate(data) {
        return request({
            url: url.ip1 + "/car/findByPage",
            method: "post",
            data: data,
        });
    },
    //获取到当前列表的车的坐标
    getCarLocation(data) {
        return request({
            url: url.ip1 + "/car/monitor/devices/tracking",
            method: "post",
            data: data,
        });
    },
    //历史轨迹查询
    getHistoryTrack(data) {
        return request({
            url: url.ip1 + "/car/monitor/car/history",
            method: "post",
            data: data,
        });
    },
    //部门绑定
    BindDept(data) {
        return request({
            url: url.ip1 + "/car/monitor/car/associated/dept",
            method: "post",
            data: data,
        });
    },
    //根据imei号获取信息
    getCarDetail(id) {
        return request({
            url: url.ip1 + "/car/monitor/find/car/" + id,
            method: "get",
        });
    },
    //车辆监管列表
    getCarList(data) {
        return request({
            url: url.ip1 + "/car/monitor/find/car",
            method: "post",
            data: data
        });
    },
    //获取区域
    getArea(id) {
        return request({
            url: url.ip2 + "/area/findAreaInfoByLevel?level=" + id + "&searchKey=",
            method: "get",
        });
    },
    //获取里程数
    getMiles(data) {
        return request({
            url: url.ip1 + "/car/monitor/car/mileage",
            method: "post",
            data: data,
        });
    },
    //车辆新增
    AddCar(data) {
        return request({
            url: url.ip1 + "/car/save",
            method: "post",
            data: data,
        })
    },
    //车辆修改
    editCar(data) {
        return request({
            url: url.ip1 + "/car/edit",
            method: "put",
            data: data,
        })
    },
    //车辆详情
    detailCar(id) {
        return request({
            url: url.ip1 + "/car/car/detail/" + id,
            method: "get",
        })
    },
    //删除车辆
    deleteDetail(id) {
        return request({
            url: url.ip1 + "/car/remove/" + id,
            method: "delete",
        })
    },
    //获取车辆类型
    getCarType() {
        return request({
            url: url.ip1 + "/car/find/car/type",
            method: "get",
        })
    },
    //获取警告总数的接口
    getRemindCount() {
        return request({
            url: url.ip1 + "/car/getRemindCount",
            method: "post",
        })
    },
});